

// export class TrainSignUpForm {
//   name: TrainFormItem;
//   parentName: TrainFormItem;
//   parentPhone: TrainFormItem;
//   sex: TrainFormItem;
//   brithday: TrainFormItem;
//   IDNum: TrainFormItem;
//   country: TrainFormItem;
//   address: TrainFormItem;
//   place: TrainFormItem;  // 籍贯
//   height: TrainFormItem;
//   weight: TrainFormItem;  // 体重
//   sport: TrainFormItem;  // 运动项目
//   professional: TrainFormItem;  // 专业特点
//   prize: TrainFormItem;  // 所获奖项
//   shcool: TrainFormItem;  // 就读学校
//   remark: TrainFormItem;  // 备注
//   nation: TrainFormItem;  // 民族n
// }
//
// export class TrainFormItem {
//   hasItem = false;
//   hasChange = false;
//   isError = false;
// }

export class TrainFormItemConfig  {
  hasItem: boolean;
  hasChange: boolean;
  isError: boolean;
  constructor() {
    this.hasItem = false;
    this.hasChange = false;
    this.isError = false;
  }
}

/**
 * 获取培训报名字段
 * 字段值与后台接口 v1/user/train/sign/getForm 返回一致
 */

export const Trainkey = [
  'name', 'parentName', 'parentPhone', 'sex',
  'birthday', 'idNo', 'nationality', 'address',
  'origin', 'height', "weight", "sportItem",
  "trait", "awardsItem", "school", "remark", "nation", 'email'];

export class TrainSignUpFormConfig {
  name: TrainFormItemConfig ;
  parentName: TrainFormItemConfig ;
  parentPhone: TrainFormItemConfig ;
  sex: TrainFormItemConfig ;
  birthday: TrainFormItemConfig ;
  idNo: TrainFormItemConfig;  // 证件号
  // certificate: TrainFormItemConfig,  // 证件号
  nationality: TrainFormItemConfig;  // 国籍
  address: TrainFormItemConfig;  // 地址
  origin: TrainFormItemConfig; // 籍贯
  height: TrainFormItemConfig;  // 身高
  weight: TrainFormItemConfig;  // 体重
  sportItem: TrainFormItemConfig;  // 运动项目
  trait: TrainFormItemConfig;  // 专业特点
  awardsItem: TrainFormItemConfig;  // 所获奖项
  school: TrainFormItemConfig;  // 就读学校
  remark: TrainFormItemConfig;  // 备注
  nation: TrainFormItemConfig;  // 民族n
  email: TrainFormItemConfig;
  constructor(arr) {
    arr.forEach(e => {
      this[e] = new TrainFormItemConfig();
    });
  }
}

export const certificate = [
  {
    title: '身份证',
    value: '1'
  },
  {
    title: '护照',
    value: '2'
  },
  {
    title: '其他证件',
    value: '3'
  },
];

